﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
using M3G;

namespace MyTestProject {

    public class TestFog {
        [Fact]
        public void TestConstructor () {
            var fog = new Fog ();

            Assert.Equal (Fog.Linear, fog.Mode);
            Assert.Equal (1.0f, fog.Density);
            Assert.Equal (0.0f, fog.NearDistance);
            Assert.Equal (1.0f, fog.FarDistance);
            Assert.Equal (0x00000000u, fog.Color);
        }

        [Fact]
        public void TestSetMode () {
            var fog = new Fog ();
            fog.Mode = Fog.ExponentialSquared;

            Assert.Equal (Fog.ExponentialSquared, fog.Mode);
        }

        [Fact]
        public void TestSetColor () {
            var fog = new Fog ();
            fog.Color = 0x12345678u;

            Assert.Equal (0x00345678u, fog.Color);
        }

        [Fact]
        public void TestSetDensity () {
            var fog = new Fog ();
            fog.Density = 99.0f;

            Assert.Equal (99.0f, fog.Density);
        }

        [Fact]
        public void TestSetLinear () {
            var fog = new Fog ();
            fog.SetLinear (1.0f, 2.0f);

            Assert.Equal (1.0f, fog.NearDistance);
            Assert.Equal (2.0f, fog.FarDistance);
        }

        [Fact]
        public void TestDuplicate () {
            var fog = new Fog ();
            fog.Mode = Fog.ExponentialSquared;
            fog.Color = 0x12345678u;
            fog.Density = 99.0f;
            fog.SetLinear (1.0f, 2.0f);
            fog.UserID = 100;

            var dup = (Fog)fog.Duplicate();

            Assert.Equal (fog.Mode, dup.Mode);
            Assert.Equal (fog.Density, dup.Density);
            Assert.Equal (fog.NearDistance, dup.NearDistance);
            Assert.Equal (fog.FarDistance, dup.FarDistance);
            Assert.Equal (fog.Color, dup.Color);
            Assert.Equal (fog.UserID, dup.UserID);
        }

    }
}
